<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAssetBundlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('asset_bundles', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string("name")->unique();
            $table->text("description");
            $table->softDeletes();
            $table->timestamps();
        });

        Schema::create('asset_bundle_items', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger("asset_bundle_id");
            $table->unsignedInteger("bundleable_id");
            $table->string("bundleable_type");
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('asset_bundle_items');
        Schema::dropIfExists('asset_bundles');
    }
}
